
var url = window.location.href;
var dataFile = getArgsFromHref(url,'datafile');

if (dataFile == "") {
    dataFile = getArgsFromHref(url);
}

function getArgsFromHref(sHref, sArgName) 
{ 
    sHref = sHref+'';
    var args = sHref.split("?");
    var retval = "";
    if(args[0] == sHref) /*参数为空*/
    { 
        return retval; /*无需做任何处理*/ 
    }
    if (sArgName==null) {
        return args[1];
    }
    var str = args[1];
    args = str.split("&"); 
    for(var i = 0; i < args.length; i ++)
    { 
        str = args[i]; 
        var arg = str.split("=");
        if(arg.length <= 1) continue; 
        if(arg[0] == sArgName) 
            retval = arg[1];
    }
    return retval;
} 
